/*
* Copyright (c) 2015 University of Illinois Board of Trustees, All rights reserved.
* Developed at GSLIS/ the iSchool, by Dr. Jana Diesner, Amirhossein Aleyasen,
* Chieh-Li Chin, Shubhanshu Mishra, Kiumars Soltani, and Liang Tao.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see <http://www.gnu.org/licenses>.
*
*/
package context.app.main;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Rectangle2D;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Screen;
import javafx.stage.Stage;
/**
*
* @author Amirhossein Aleyasen <aleyase2@illinois.edu>
*/
public class ContextFX extends Application {
/**
*
*/
public static ContextFXController appController;
/**
*
*/
public static void initialize() {
}
/**
*
* @param stage
* @throws Exception
*/
@Override
public void start(Stage stage) throws Exception {
initialize();
FXMLLoader loader = new FXMLLoader(getClass().getResource("ContextFX.fxml"));
Parent root = (Parent) loader.load();
//root.getStylesheets().add("style-default.css");
appController = (ContextFXController) loader.getController();
appController.setStageAndSetupListeners(stage);
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setTitle("ConText 1.2.0");//From August 2015, it becomes ConText 1.1 //Jan 2016 - 1.2.X
stage.getIcons().add(new Image("resources/context-blue.png"));
Screen screen = Screen.getPrimary();
Rectangle2D bounds = screen.getVisualBounds();
stage.setX(bounds.getMinX());
stage.setY(bounds.getMinY());
stage.setWidth(bounds.getWidth());
stage.setHeight(bounds.getHeight());
stage.show();
}
/**
* The main() method is ignored in correctly deployed JavaFX application.
* main() serves only as fallback in case the application can not be
* launched through deployment artifacts, e.g., in IDEs with limited FX
* support. NetBeans ignores main().
*
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}